# 自定义进程

from multiprocessing import Process
from time import sleep


class MyProcess(Process):

    def __init__(self, name):
        super(MyProcess, self).__init__()
        self.name = name

    # 重写run方法
    def run(self):
        n = 1
        while True:
            # print("进程的名字", self.name)
            print("{}---------->自定义进程,n----->{}".format(self.name, n))
            n += 1


if __name__ == '__main__':
    p = MyProcess("张三")
    p.start()
    sleep(1)
    p1 = MyProcess("李四")
    p1.start()
